import request from '@/utils/request'

// 查询能源报表列表
export function listReport(query) {
  return request({
    url: '/energy/report/list',
    method: 'get',
    params: query
  })
}

// 查询能源报表详细
export function getReport(reportId) {
  return request({
    url: '/energy/report/' + reportId,
    method: 'get'
  })
}

// 新增能源报表
export function addReport(data) {
  return request({
    url: '/energy/report',
    method: 'post',
    data: data
  })
}

// 修改能源报表
export function updateReport(data) {
  return request({
    url: '/energy/report',
    method: 'put',
    data: data
  })
}

// 删除能源报表
export function delReport(reportId) {
  return request({
    url: '/energy/report/' + reportId,
    method: 'delete'
  })
}

// 根据日期范围查询报表
export function getReportByDateRange(params) {
  return request({
    url: '/energy/report/dateRange',
    method: 'get',
    params: params
  })
}

// 查询设备能耗趋势
export function getEnergyTrend(deviceId, params) {
  return request({
    url: '/energy/report/trend/' + deviceId,
    method: 'get',
    params: params
  })
}

// 查询能耗排行榜
export function getEnergyRanking(params) {
  return request({
    url: '/energy/report/ranking',
    method: 'get',
    params: params
  })
}

// 查询综合统计数据
export function getComprehensiveStats(params) {
  return request({
    url: '/energy/report/stats',
    method: 'get',
    params: params
  })
}

// 生成报表数据
export function generateReport(params) {
  return request({
    url: '/energy/report/generate',
    method: 'post',
    params: params
  })
}

// 查询仪表盘统计数据
export function getDashboardStats() {
  return request({
    url: '/energy/report/dashboard',
    method: 'get'
  })
}

// 导出能源报表
export function exportReport(query) {
  return request({
    url: '/energy/report/export',
    method: 'post',
    data: query,
    responseType: 'blob'
  })
} 